feat: Share runs via Python SDK#667
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to add “run sharing” capabilities to the Python SDK by introducing access-control resource wrappers (grants + share tokens), wiring them into the platform client, and exposing sharing workflows through the application service and CLI.
Changes:
- Added new access-control resource layer (
AccessGrant,ShareToken,ShareTokens) and newRunhelpers (list_share_grants,grant_access). - Added new application service + CLI commands under
run share ...to list/grant/revoke access and manage share tokens. - Regenerated codegen artifacts/docs for updated API parameters (e.g., grants relation filter, additional run filters, run organization_id field).
Reviewed changes
Copilot reviewed 8 out of 61 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
src/aignostics/platform/resources/access.py |
New access-control resource models and share-token listing/creation logic. |
src/aignostics/platform/resources/runs.py |
Adds run-level grant listing/creation helpers with caching/retry integration. |
src/aignostics/platform/_client.py |
Exposes a share_tokens resource on Client. |
src/aignostics/application/_service.py |
Adds service methods for run sharing and token management. |
src/aignostics/application/_cli.py |
Adds run share ... CLI command group. |
tests/aignostics/platform/resources/access_test.py |
Unit tests for access resources. |
tests/aignostics/platform/resources/run_sharing_test.py |
Unit tests for run-sharing workflows (currently mismatched with implementation). |
codegen/in/openapi.json + codegen/out/** |
Codegen updates reflecting API spec changes. |
Codecov Report❌ Patch coverage is
|
3bbec8d to
1131c91
Compare
1131c91 to
fa0f3b9
Compare
fa0f3b9 to
c4e64be
Compare
ffa17dc to
ece8b91
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
64cd279 to
6ea4f1f
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…-based filtering The service now cross-filters share tokens against active grants instead of relying on ShareTokens.list(run_id=...). Update the unit test to wire up the mock client (was missing mock_get_client.return_value), configure a matching grant on the mock run, and assert that list_share_grants is called with the correct arguments. Also restore run_dont_commit.py to pyrightconfig.json ignore list. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
In addition to the SPECs outlined in the CR, we should also update the CLI Interface section in specifications/SPEC-APPLICATION-SERVICE.md with a short summary of the new commands |
…4-2 to high-level statements Replace API-implementation-detail wording with concise, high-level requirement statements per review feedback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SonarCloud was reporting 0% coverage because it ran in parallel with the test job and had no coverage.xml available. It also lacked the sonar.python.coverage.reportPaths property to find the report. - Add `test` to sonarcloud job's `needs` so it runs after tests finish - Download test-results-ubuntu-latest artifact before the scan - Add sonar.python.coverage.reportPaths=reports/coverage.xml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If tests fail before coverage.xml is generated, the artifact won't exist and the download would error out the sonarcloud job. Using continue-on-error lets SonarCloud still run (without coverage data) rather than failing entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2a76587 to
6ae872e
Compare
6ae872e to
0bc4980
Compare
|



No description provided.